//
//  HCBaseViewController.m
//  hcpro
//
//  Created by hc on 16/9/22.
//  Copyright © 2016年 hucai.com. All rights reserved.
//

#import "HCBaseViewController.h"

@interface HCBaseViewController ()

@end

@implementation HCBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImage *leftItemImg = [UIImage imageNamed:@"btn_menu"];
    WEAKSELF
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] bk_initWithImage:leftItemImg style:UIBarButtonItemStyleDone handler:^(id  _Nonnull sender) {
        /** 打开/关闭侧边栏 */
        CGFloat viewX = self.navigationController.view.hc_x;
        // 隐藏
        if (viewX > 0) {
            [UIView animateWithDuration:0.6 animations:^{
                [weakSelf.navigationController.view setHc_x:0];
            }];
        }
        // 显示
        else{
            [UIView animateWithDuration:0.6 animations:^{
                [weakSelf.navigationController.view setHc_x:HCSlideMenuW];
            }];
        }

    }];
    self.navigationItem.leftBarButtonItem = leftItem;
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    
    self.view.backgroundColor = HCBGColor;
}

@end
